.class public Lcom/instagram/h/a/a;
.super Ljava/lang/Object;
.source "ImpressionTracker.java"


# static fields
.field private static a:Landroid/content/SharedPreferences;

.field private static b:Landroid/content/SharedPreferences;


# instance fields
.field private final c:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Lcom/instagram/h/a/f;",
            ">;"
        }
    .end annotation
.end field

.field private final d:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Lcom/instagram/h/a/f;",
            ">;"
        }
    .end annotation
.end field

.field private final e:Lcom/instagram/b/d;


# direct methods
.method public constructor <init>(Lcom/instagram/b/d;)V
    .locals 1
    .parameter

    .prologue
    .line 75
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 50
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lcom/instagram/h/a/a;->c:Ljava/util/Map;

    .line 57
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lcom/instagram/h/a/a;->d:Ljava/util/Map;

    .line 76
    iput-object p1, p0, Lcom/instagram/h/a/a;->e:Lcom/instagram/b/d;

    .line 77
    return-void
.end method

.method private static a(Lcom/instagram/j/l;Lcom/instagram/h/a/b;)Ljava/lang/String;
    .locals 2
    .parameter
    .parameter

    .prologue
    const/4 v0, 0x0

    .line 92
    invoke-static {p0}, Lcom/instagram/h/a/a;->c(Lcom/instagram/j/l;)Ljava/lang/String;

    move-result-object v1

    if-nez v1, :cond_1

    .line 101
    :cond_0
    :goto_0
    return-object v0

    .line 96
    :cond_1
    sget-object v1, Lcom/instagram/h/a/b;->a:Lcom/instagram/h/a/b;

    invoke-virtual {v1, p1}, Lcom/instagram/h/a/b;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_2

    .line 97
    invoke-static {p0}, Lcom/instagram/h/a/a;->c(Lcom/instagram/j/l;)Ljava/lang/String;

    move-result-object v0

    goto :goto_0

    .line 98
    :cond_2
    sget-object v1, Lcom/instagram/h/a/b;->b:Lcom/instagram/h/a/b;

    invoke-virtual {v1, p1}, Lcom/instagram/h/a/b;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 99
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-static {p0}, Lcom/instagram/h/a/a;->c(Lcom/instagram/j/l;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "_LAST_VIEWED_IMPRESSION_TIME"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    goto :goto_0
.end method

.method public static a()V
    .locals 1

    .prologue
    const/4 v0, 0x0

    .line 71
    sput-object v0, Lcom/instagram/h/a/a;->a:Landroid/content/SharedPreferences;

    .line 72
    sput-object v0, Lcom/instagram/h/a/a;->b:Landroid/content/SharedPreferences;

    .line 73
    return-void
.end method

.method private a(Landroid/content/SharedPreferences$Editor;)V
    .locals 2
    .parameter

    .prologue
    .line 348
    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v1, 0x9

    if-lt v0, v1, :cond_0

    .line 349
    invoke-direct {p0, p1}, Lcom/instagram/h/a/a;->b(Landroid/content/SharedPreferences$Editor;)V

    .line 353
    :goto_0
    return-void

    .line 351
    :cond_0
    invoke-direct {p0, p1}, Lcom/instagram/h/a/a;->c(Landroid/content/SharedPreferences$Editor;)V

    goto :goto_0
.end method

.method private a(Landroid/content/SharedPreferences;)V
    .locals 5
    .parameter

    .prologue
    .line 330
    new-instance v0, Ljava/util/ArrayList;

    invoke-interface {p1}, Landroid/content/SharedPreferences;->getAll()Ljava/util/Map;

    move-result-object v1

    invoke-interface {v1}, Ljava/util/Map;->values()Ljava/util/Collection;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V

    .line 333
    invoke-static {v0}, Ljava/util/Collections;->sort(Ljava/util/List;)V

    .line 334
    const/16 v1, 0x31

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Long;

    .line 336
    invoke-interface {p1}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v3

    .line 338
    invoke-interface {p1}, Landroid/content/SharedPreferences;->getAll()Ljava/util/Map;

    move-result-object v1

    invoke-interface {v1}, Ljava/util/Map;->entrySet()Ljava/util/Set;

    move-result-object v1

    invoke-interface {v1}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v4

    :cond_0
    :goto_0
    invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_1

    invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/util/Map$Entry;

    .line 339
    invoke-interface {v1}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/Long;

    invoke-virtual {v2, v0}, Ljava/lang/Long;->compareTo(Ljava/lang/Long;)I

    move-result v2

    if-gtz v2, :cond_0

    .line 340
    invoke-interface {v1}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/String;

    invoke-interface {v3, v1}, Landroid/content/SharedPreferences$Editor;->remove(Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    goto :goto_0

    .line 344
    :cond_1
    invoke-direct {p0, v3}, Lcom/instagram/h/a/a;->a(Landroid/content/SharedPreferences$Editor;)V

    .line 345
    return-void
.end method

.method private a(Lcom/instagram/j/l;JILcom/instagram/b/d;)V
    .locals 6
    .parameter
    .parameter
    .parameter
    .parameter

    .prologue
    .line 253
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    .line 254
    sub-long v2, v0, p2

    const-wide/16 v4, 0x3e8

    cmp-long v2, v2, v4

    if-gez v2, :cond_1

    .line 279
    :cond_0
    :goto_0
    return-void

    .line 259
    :cond_1
    sget-object v2, Lcom/instagram/h/a/b;->b:Lcom/instagram/h/a/b;

    invoke-direct {p0, p1, v2}, Lcom/instagram/h/a/a;->c(Lcom/instagram/j/l;Lcom/instagram/h/a/b;)Z

    move-result v2

    if-nez v2, :cond_2

    .line 260
    const-string v2, "viewed_impression"

    invoke-static {v2, p1, p4, p5}, Lcom/instagram/h/a/c;->a(Ljava/lang/String;Lcom/instagram/j/l;ILcom/instagram/b/d;)V

    .line 264
    sget-object v2, Lcom/instagram/h/a/b;->b:Lcom/instagram/h/a/b;

    invoke-direct {p0, p1, v2, v0, v1}, Lcom/instagram/h/a/a;->a(Lcom/instagram/j/l;Lcom/instagram/h/a/b;J)V

    goto :goto_0

    .line 269
    :cond_2
    sget-object v2, Lcom/instagram/h/a/b;->b:Lcom/instagram/h/a/b;

    invoke-direct {p0, p1, v2}, Lcom/instagram/h/a/a;->b(Lcom/instagram/j/l;Lcom/instagram/h/a/b;)J

    move-result-wide v2

    sub-long v2, v0, v2

    .line 271
    const-wide/32 v4, 0xea60

    cmp-long v2, v2, v4

    if-lez v2, :cond_0

    .line 272
    const-string v2, "sub_viewed_impression"

    invoke-static {v2, p1, p4, p5}, Lcom/instagram/h/a/c;->a(Ljava/lang/String;Lcom/instagram/j/l;ILcom/instagram/b/d;)V

    .line 276
    sget-object v2, Lcom/instagram/h/a/b;->b:Lcom/instagram/h/a/b;

    invoke-direct {p0, p1, v2, v0, v1}, Lcom/instagram/h/a/a;->a(Lcom/instagram/j/l;Lcom/instagram/h/a/b;J)V

    goto :goto_0
.end method

.method private a(Lcom/instagram/j/l;Lcom/instagram/h/a/b;J)V
    .locals 3
    .parameter
    .parameter
    .parameter

    .prologue
    .line 145
    invoke-static {p1, p2}, Lcom/instagram/h/a/a;->a(Lcom/instagram/j/l;Lcom/instagram/h/a/b;)Ljava/lang/String;

    move-result-object v0

    .line 146
    invoke-direct {p0, p1}, Lcom/instagram/h/a/a;->d(Lcom/instagram/j/l;)Landroid/content/SharedPreferences;

    move-result-object v1

    .line 148
    invoke-interface {v1}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v2

    invoke-interface {v2, v0, p3, p4}, Landroid/content/SharedPreferences$Editor;->putLong(Ljava/lang/String;J)Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    invoke-direct {p0, v0}, Lcom/instagram/h/a/a;->a(Landroid/content/SharedPreferences$Editor;)V

    .line 150
    invoke-interface {v1}, Landroid/content/SharedPreferences;->getAll()Ljava/util/Map;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/Map;->size()I

    move-result v0

    const/16 v2, 0xc8

    if-le v0, v2, :cond_0

    .line 151
    invoke-direct {p0, v1}, Lcom/instagram/h/a/a;->a(Landroid/content/SharedPreferences;)V

    .line 153
    :cond_0
    return-void
.end method

.method private b(Lcom/instagram/j/l;Lcom/instagram/h/a/b;)J
    .locals 4
    .parameter
    .parameter

    .prologue
    .line 129
    invoke-static {p1, p2}, Lcom/instagram/h/a/a;->a(Lcom/instagram/j/l;Lcom/instagram/h/a/b;)Ljava/lang/String;

    move-result-object v0

    .line 130
    invoke-direct {p0, p1}, Lcom/instagram/h/a/a;->d(Lcom/instagram/j/l;)Landroid/content/SharedPreferences;

    move-result-object v1

    .line 132
    const-wide/16 v2, 0x0

    invoke-interface {v1, v0, v2, v3}, Landroid/content/SharedPreferences;->getLong(Ljava/lang/String;J)J

    move-result-wide v0

    return-wide v0
.end method

.method private b(Landroid/content/SharedPreferences$Editor;)V
    .locals 0
    .parameter
    .annotation build Landroid/annotation/TargetApi;
        value = 0x9
    .end annotation

    .prologue
    .line 357
    invoke-interface {p1}, Landroid/content/SharedPreferences$Editor;->apply()V

    .line 358
    return-void
.end method

.method private static c(Lcom/instagram/j/l;)Ljava/lang/String;
    .locals 1
    .parameter

    .prologue
    .line 80
    invoke-virtual {p0}, Lcom/instagram/j/l;->Y()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 82
    invoke-virtual {p0}, Lcom/instagram/j/l;->ae()Ljava/lang/String;

    move-result-object v0

    .line 83
    invoke-virtual {v0}, Ljava/lang/String;->hashCode()I

    move-result v0

    invoke-static {v0}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;

    move-result-object v0

    .line 87
    :goto_0
    return-object v0

    .line 84
    :cond_0
    invoke-virtual {p0}, Lcom/instagram/j/l;->ad()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 85
    invoke-virtual {p0}, Lcom/instagram/j/l;->c()Ljava/lang/String;

    move-result-object v0

    goto :goto_0

    .line 87
    :cond_1
    const/4 v0, 0x0

    goto :goto_0
.end method

.method private c(Landroid/content/SharedPreferences$Editor;)V
    .locals 0
    .parameter

    .prologue
    .line 361
    invoke-interface {p1}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 362
    return-void
.end method

.method private c(Lcom/instagram/j/l;Lcom/instagram/h/a/b;)Z
    .locals 2
    .parameter
    .parameter

    .prologue
    .line 162
    invoke-static {p1, p2}, Lcom/instagram/h/a/a;->a(Lcom/instagram/j/l;Lcom/instagram/h/a/b;)Ljava/lang/String;

    move-result-object v0

    .line 163
    invoke-direct {p0, p1}, Lcom/instagram/h/a/a;->d(Lcom/instagram/j/l;)Landroid/content/SharedPreferences;

    move-result-object v1

    .line 165
    invoke-interface {v1, v0}, Landroid/content/SharedPreferences;->contains(Ljava/lang/String;)Z

    move-result v0

    return v0
.end method

.method private d(Lcom/instagram/j/l;)Landroid/content/SharedPreferences;
    .locals 1
    .parameter

    .prologue
    .line 106
    invoke-static {}, Lcom/instagram/h/a/a;->e()V

    .line 107
    invoke-virtual {p1}, Lcom/instagram/j/l;->Y()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 108
    sget-object v0, Lcom/instagram/h/a/a;->a:Landroid/content/SharedPreferences;

    .line 112
    :goto_0
    return-object v0

    .line 109
    :cond_0
    invoke-virtual {p1}, Lcom/instagram/j/l;->ad()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 110
    sget-object v0, Lcom/instagram/h/a/a;->b:Landroid/content/SharedPreferences;

    goto :goto_0

    .line 112
    :cond_1
    const/4 v0, 0x0

    goto :goto_0
.end method

.method private static declared-synchronized e()V
    .locals 2

    .prologue
    .line 63
    const-class v1, Lcom/instagram/h/a/a;

    monitor-enter v1

    :try_start_0
    sget-object v0, Lcom/instagram/h/a/a;->a:Landroid/content/SharedPreferences;

    if-eqz v0, :cond_0

    sget-object v0, Lcom/instagram/h/a/a;->b:Landroid/content/SharedPreferences;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    if-eqz v0, :cond_0

    .line 68
    :goto_0
    monitor-exit v1

    return-void

    .line 66
    :cond_0
    :try_start_1
    const-string v0, "starred_view"

    invoke-static {v0}, Lcom/instagram/m/b/a/a;->a(Ljava/lang/String;)Landroid/content/SharedPreferences;

    move-result-object v0

    sput-object v0, Lcom/instagram/h/a/a;->a:Landroid/content/SharedPreferences;

    .line 67
    const-string v0, "organic_view"

    invoke-static {v0}, Lcom/instagram/m/b/a/a;->a(Ljava/lang/String;)Landroid/content/SharedPreferences;

    move-result-object v0

    sput-object v0, Lcom/instagram/h/a/a;->b:Landroid/content/SharedPreferences;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    .line 63
    :catchall_0
    move-exception v0

    monitor-exit v1

    throw v0
.end method

.method private e(Lcom/instagram/j/l;)Z
    .locals 1
    .parameter

    .prologue
    .line 117
    invoke-static {p1}, Lcom/instagram/h/a/a;->c(Lcom/instagram/j/l;)Ljava/lang/String;

    move-result-object v0

    if-eqz v0, :cond_0

    invoke-direct {p0, p1}, Lcom/instagram/h/a/a;->d(Lcom/instagram/j/l;)Landroid/content/SharedPreferences;

    move-result-object v0

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method


# virtual methods
.method public a(Lcom/instagram/j/l;)V
    .locals 7
    .parameter

    .prologue
    .line 194
    invoke-direct {p0, p1}, Lcom/instagram/h/a/a;->e(Lcom/instagram/j/l;)Z

    move-result v0

    if-nez v0, :cond_1

    .line 214
    :cond_0
    :goto_0
    return-void

    .line 198
    :cond_1
    iget-object v0, p0, Lcom/instagram/h/a/a;->d:Ljava/util/Map;

    invoke-static {p1}, Lcom/instagram/h/a/a;->c(Lcom/instagram/j/l;)Ljava/lang/String;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/Map;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    move-object v1, v0

    check-cast v1, Lcom/instagram/h/a/f;

    .line 199
    if-eqz v1, :cond_0

    .line 205
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    .line 206
    iget-object v0, v1, Lcom/instagram/h/a/f;->b:Ljava/lang/Long;

    invoke-virtual {v0}, Ljava/lang/Long;->longValue()J

    move-result-wide v4

    sub-long v3, v2, v4

    .line 207
    const-wide/16 v5, 0x1f4

    cmp-long v0, v3, v5

    if-lez v0, :cond_0

    .line 208
    const-string v0, "time_spent"

    iget v2, v1, Lcom/instagram/h/a/f;->d:I

    iget-object v5, p0, Lcom/instagram/h/a/a;->e:Lcom/instagram/b/d;

    move-object v1, p1

    invoke-static/range {v0 .. v5}, Lcom/instagram/h/a/c;->a(Ljava/lang/String;Lcom/instagram/j/l;IJLcom/instagram/b/d;)V

    goto :goto_0
.end method

.method public a(Lcom/instagram/j/l;I)V
    .locals 6
    .parameter
    .parameter

    .prologue
    .line 169
    invoke-direct {p0, p1}, Lcom/instagram/h/a/a;->e(Lcom/instagram/j/l;)Z

    move-result v0

    if-nez v0, :cond_1

    .line 191
    :cond_0
    :goto_0
    return-void

    .line 173
    :cond_1
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    .line 176
    sget-object v2, Lcom/instagram/h/a/b;->a:Lcom/instagram/h/a/b;

    invoke-direct {p0, p1, v2}, Lcom/instagram/h/a/a;->c(Lcom/instagram/j/l;Lcom/instagram/h/a/b;)Z

    move-result v2

    if-nez v2, :cond_2

    .line 177
    const-string v2, "impression"

    iget-object v3, p0, Lcom/instagram/h/a/a;->e:Lcom/instagram/b/d;

    invoke-static {v2, p1, p2, v3}, Lcom/instagram/h/a/c;->a(Ljava/lang/String;Lcom/instagram/j/l;ILcom/instagram/b/d;)V

    .line 178
    sget-object v2, Lcom/instagram/h/a/b;->a:Lcom/instagram/h/a/b;

    invoke-direct {p0, p1, v2, v0, v1}, Lcom/instagram/h/a/a;->a(Lcom/instagram/j/l;Lcom/instagram/h/a/b;J)V

    goto :goto_0

    .line 183
    :cond_2
    sget-object v2, Lcom/instagram/h/a/b;->a:Lcom/instagram/h/a/b;

    invoke-direct {p0, p1, v2}, Lcom/instagram/h/a/a;->b(Lcom/instagram/j/l;Lcom/instagram/h/a/b;)J

    move-result-wide v2

    .line 184
    const-wide/32 v4, 0xea60

    add-long/2addr v2, v4

    cmp-long v2, v0, v2

    if-lez v2, :cond_0

    .line 185
    const-string v2, "sub_impression"

    iget-object v3, p0, Lcom/instagram/h/a/a;->e:Lcom/instagram/b/d;

    invoke-static {v2, p1, p2, v3}, Lcom/instagram/h/a/c;->a(Ljava/lang/String;Lcom/instagram/j/l;ILcom/instagram/b/d;)V

    .line 189
    sget-object v2, Lcom/instagram/h/a/b;->a:Lcom/instagram/h/a/b;

    invoke-direct {p0, p1, v2, v0, v1}, Lcom/instagram/h/a/a;->a(Lcom/instagram/j/l;Lcom/instagram/h/a/b;J)V

    goto :goto_0
.end method

.method public b()V
    .locals 9

    .prologue
    .line 285
    iget-object v0, p0, Lcom/instagram/h/a/a;->c:Ljava/util/Map;

    invoke-interface {v0}, Ljava/util/Map;->entrySet()Ljava/util/Set;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v6

    .line 287
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v7

    .line 289
    :goto_0
    invoke-interface {v6}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 290
    invoke-interface {v6}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/Map$Entry;

    .line 291
    invoke-interface {v0}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/instagram/h/a/f;

    .line 295
    iget-object v1, v0, Lcom/instagram/h/a/f;->a:Lcom/instagram/j/l;

    iget-object v2, v0, Lcom/instagram/h/a/f;->b:Ljava/lang/Long;

    invoke-virtual {v2}, Ljava/lang/Long;->longValue()J

    move-result-wide v2

    sub-long v2, v7, v2

    iget v4, v0, Lcom/instagram/h/a/f;->d:I

    iget-object v5, p0, Lcom/instagram/h/a/a;->e:Lcom/instagram/b/d;

    move-object v0, p0

    invoke-direct/range {v0 .. v5}, Lcom/instagram/h/a/a;->a(Lcom/instagram/j/l;JILcom/instagram/b/d;)V

    goto :goto_0

    .line 301
    :cond_0
    iget-object v0, p0, Lcom/instagram/h/a/a;->d:Ljava/util/Map;

    invoke-interface {v0}, Ljava/util/Map;->clear()V

    .line 302
    return-void
.end method

.method public b(Lcom/instagram/j/l;)V
    .locals 7
    .parameter

    .prologue
    .line 225
    invoke-direct {p0, p1}, Lcom/instagram/h/a/a;->e(Lcom/instagram/j/l;)Z

    move-result v0

    if-nez v0, :cond_0

    .line 239
    :goto_0
    return-void

    .line 228
    :cond_0
    iget-object v0, p0, Lcom/instagram/h/a/a;->c:Ljava/util/Map;

    invoke-static {p1}, Lcom/instagram/h/a/a;->c(Lcom/instagram/j/l;)Ljava/lang/String;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/Map;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/instagram/h/a/f;

    .line 229
    if-nez v0, :cond_1

    .line 230
    const-string v0, "ImpressionTracker"

    const-string v1, "Viewable info missing for media with key %s"

    const/4 v2, 0x1

    new-array v2, v2, [Ljava/lang/Object;

    const/4 v3, 0x0

    invoke-static {p1}, Lcom/instagram/h/a/a;->c(Lcom/instagram/j/l;)Ljava/lang/String;

    move-result-object v4

    aput-object v4, v2, v3

    invoke-static {v0, v1, v2}, Lcom/facebook/e/a/a;->c(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V

    goto :goto_0

    .line 234
    :cond_1
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v1

    .line 235
    iget-object v3, p0, Lcom/instagram/h/a/a;->d:Ljava/util/Map;

    invoke-static {p1}, Lcom/instagram/h/a/a;->c(Lcom/instagram/j/l;)Ljava/lang/String;

    move-result-object v4

    new-instance v5, Lcom/instagram/h/a/f;

    iget-object v6, v0, Lcom/instagram/h/a/f;->b:Ljava/lang/Long;

    invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v1

    iget v2, v0, Lcom/instagram/h/a/f;->d:I

    invoke-direct {v5, p1, v6, v1, v2}, Lcom/instagram/h/a/f;-><init>(Lcom/instagram/j/l;Ljava/lang/Long;Ljava/lang/Long;I)V

    invoke-interface {v3, v4, v5}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 238
    iget-object v1, v0, Lcom/instagram/h/a/f;->b:Ljava/lang/Long;

    invoke-virtual {v1}, Ljava/lang/Long;->longValue()J

    move-result-wide v2

    iget v4, v0, Lcom/instagram/h/a/f;->d:I

    iget-object v5, p0, Lcom/instagram/h/a/a;->e:Lcom/instagram/b/d;

    move-object v0, p0

    move-object v1, p1

    invoke-direct/range {v0 .. v5}, Lcom/instagram/h/a/a;->a(Lcom/instagram/j/l;JILcom/instagram/b/d;)V

    goto :goto_0
.end method

.method public b(Lcom/instagram/j/l;I)V
    .locals 5
    .parameter
    .parameter

    .prologue
    .line 217
    invoke-direct {p0, p1}, Lcom/instagram/h/a/a;->e(Lcom/instagram/j/l;)Z

    move-result v0

    if-nez v0, :cond_0

    .line 222
    :goto_0
    return-void

    .line 220
    :cond_0
    iget-object v0, p0, Lcom/instagram/h/a/a;->c:Ljava/util/Map;

    invoke-static {p1}, Lcom/instagram/h/a/a;->c(Lcom/instagram/j/l;)Ljava/lang/String;

    move-result-object v1

    new-instance v2, Lcom/instagram/h/a/f;

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v3

    invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v3

    const/4 v4, 0x0

    invoke-direct {v2, p1, v3, v4, p2}, Lcom/instagram/h/a/f;-><init>(Lcom/instagram/j/l;Ljava/lang/Long;Ljava/lang/Long;I)V

    invoke-interface {v0, v1, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    goto :goto_0
.end method

.method public c()V
    .locals 10

    .prologue
    .line 307
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    .line 308
    new-instance v4, Ljava/util/HashMap;

    invoke-direct {v4}, Ljava/util/HashMap;-><init>()V

    .line 309
    iget-object v0, p0, Lcom/instagram/h/a/a;->c:Ljava/util/Map;

    invoke-interface {v0}, Ljava/util/Map;->entrySet()Ljava/util/Set;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v5

    :goto_0
    invoke-interface {v5}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-interface {v5}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/Map$Entry;

    .line 310
    invoke-interface {v0}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/String;

    .line 311
    invoke-interface {v0}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/instagram/h/a/f;

    .line 313
    new-instance v6, Lcom/instagram/h/a/f;

    iget-object v7, v0, Lcom/instagram/h/a/f;->a:Lcom/instagram/j/l;

    invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v8

    const/4 v9, 0x0

    iget v0, v0, Lcom/instagram/h/a/f;->d:I

    invoke-direct {v6, v7, v8, v9, v0}, Lcom/instagram/h/a/f;-><init>(Lcom/instagram/j/l;Ljava/lang/Long;Ljava/lang/Long;I)V

    .line 317
    invoke-interface {v4, v1, v6}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    goto :goto_0

    .line 319
    :cond_0
    iget-object v0, p0, Lcom/instagram/h/a/a;->c:Ljava/util/Map;

    invoke-interface {v0}, Ljava/util/Map;->clear()V

    .line 320
    iget-object v0, p0, Lcom/instagram/h/a/a;->c:Ljava/util/Map;

    invoke-interface {v0, v4}, Ljava/util/Map;->putAll(Ljava/util/Map;)V

    .line 321
    return-void
.end method

.method public d()V
    .locals 1

    .prologue
    .line 324
    iget-object v0, p0, Lcom/instagram/h/a/a;->c:Ljava/util/Map;

    invoke-interface {v0}, Ljava/util/Map;->clear()V

    .line 325
    iget-object v0, p0, Lcom/instagram/h/a/a;->d:Ljava/util/Map;

    invoke-interface {v0}, Ljava/util/Map;->clear()V

    .line 326
    return-void
.end method
